<template>
  <!-- 商品列表 -->
  <div class="item-block order-goods">
    <ul>
      <!-- 是否为虚拟商品、是否免物流（虚拟商品一定是免物流的） -->
      <li class="goods-li"
          v-for="(goods,index) in buyLists"
          :key="index"
          :data-is_item_virtual="goods.is_item_virtual"
          :data-is_free_logistics="goods.is_free_logistics"
          @click="JumpName('item-detail',{detailId:goods.item_id})">
        <section class="order-goods-img" id="good_img"> <!-- 跳商品详情页带id-->
          <img :src="goods.pic_url+'180x180'"  v-if="goods.is_compress">
          <img :src="goods.pic_url"  v-else>
        </section>
        <section class="order-goods-infor g-flex">
          <div class="goods-title">
            {{goods.title}}<b v-if="goods.freight_payer==4" style="color:#F30C23">（运费到付）</b>
          </div>
          <!-- 所有图标 -->
          <p class="item-tips-box">
            <span class="item-tips fontZhouQG" v-if="goods.is_cycle&&goods.is_cycle==1">周期购</span>
            <span class="item-tips fontBaos" v-if="isOpenKuajing && goods.item_config &&goods.item_config.kuajing_type ==1">保税商品</span>
            <span class="item-tips kj_mark" v-if="isOpenKuajing && goods.item_config &&goods.item_config.kuajing_type ==2">海外直邮</span>
            <span class="item-tips fontPresell" v-if="goods.is_presale">预售</span>
            <span class="item-tips first_gift_title" v-if="goods.is_first_gift">{{label_name}}</span>
            <!--买赠buy_gift_type 1赠品 2设置的商品-->
            <span class="item-tips gift-tips" v-if="goods.buy_gift_type == 1">赠品</span>
            <span class="item-tips gift-tips" v-else-if="goods.buy_gift_type == 2">买赠</span>
          </p>
          <p class="goods-props" v-if="goods.item_date">{{goods.item_config.shopping_date_name}}：{{goods.item_date}}</p>
          <p class="goods-props" v-if="goods.item_memo">备注：{{goods.item_memo}}</p>
          <p class="goods-props" v-if="goods.props">{{goods.props}}</p>
          <!-- 商品价格 -->
          <p class="price_num">
            <span class="price_box" v-if="goods.is_first_gift&&goods.original_price>0">
              <span class="price"  v-html="scaleGoodsPriceFn(goods.original_price)"></span>
            </span>
            <span class="price_box" v-if="goods.is_presale">
              <span class="price"  v-html="scaleGoodsPriceFn(goods.price)"></span>
              <em v-if="isPaypal==1" class="dollar-price">&dollar;{{goods.dollar_price}}</em>
            </span>
            <span class="price_box" v-else>
              <span class="price" v-if="isDzWm" v-html="scaleGoodsPriceFn(goods.dz_price)"></span>
              <span class="price" v-else v-html="scaleGoodsPriceFn(goods.price)"></span>
              <span v-if="goods.cash_point" style="color:#F30C23;">（包含{{goods.cash_point}}金额兑换）</span>
              <em v-if="isPaypal==1 && goods.dollar_price>0" class="dollar-price">&dollar;{{goods.dollar_price}}</em>
            </span>
            <span class="num">&times;<i class="J-num">{{goods.num}}</i></span>
          </p>
          <p class="presell" v-if="goods.is_presale">
            <i class="presell_money">定金:</i>
            <b class="presell_num" v-html="scaleGoodsPriceFn(goods.presale_pirce)"></b>
          </p>
        </section>
      </li>
    </ul>
  </div>
</template>

<script>
import Vue from 'vue'
import { scaleGoodsPrice } from '@/utils/index.js'
export default Vue.extend({
  props: {
    buyLists: {
      type: Array,
      default() {
        return []
      }
    },
    isPaypal: '',
    isOpenKuajing: '',
    isDzWm: false
  },
  data() {
    return {
      consumPoints: 0,
      consumPrices: 0,
      subArr: []
    }
  },
  methods: {
    scaleGoodsPriceFn(price) {
      return scaleGoodsPrice(price)
    },
    JumpName(url, data) {
      this.$JumpName(this, url, data)
    }
  }
})
</script>

<style>

</style>
